<!--
 * @Author: your name
 * @Date: 2022-01-06 08:32:12
 * @LastEditTime: 2022-01-10 08:43:16
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \elementui\src\views\Home.vue
-->
<template>
  <div class="home">
    <el-container style="height: 500px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu>
          <router-link to="/home/all">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-menu"></i>全部文件</template>
            <!-- <el-menu-item-group>
              <template slot="title">分组一</template>
              <el-menu-item index="2-1">选项1</el-menu-item>
              <el-menu-item index="2-2">选项2</el-menu-item>
            </el-menu-item-group> -->
          </el-submenu>
          </router-link>
          <router-link to="/home/userlist">
          <el-submenu index="2">
            <template slot="title"
              ><i class="el-icon-setting"></i>网站偏好</template
            >
          </el-submenu>
          </router-link>
          <router-link to="/home/hao">
          <el-submenu index="3">
            <template slot="title"
              ><i class="el-icon-setting"></i>用户列表</template
            >
          </el-submenu>
          </router-link>
          <el-submenu index="4">
            <template slot="title"
              ><i class="el-icon-setting"></i><span @click="fn_quit">退出登录</span></template
            >
          </el-submenu>
        </el-menu>
      </el-aside>


      <!-- 主体 -->
      <!-- <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>查看</el-dropdown-item>
              <el-dropdown-item>新增</el-dropdown-item>
              <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <span>王小虎</span>
        </el-header>
        
        <el-main>
          <el-table :data="tableData">
            <el-table-column prop="date" label="日期" width="140">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="120">
            </el-table-column>
            <el-table-column prop="address" label="地址"> </el-table-column>
          </el-table>
        </el-main>
      </el-container> -->
    <el-container>
      <router-view />
    </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name:"Home",
  data() {
    const item = {
      date: "2016-05-02",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1518 弄",
    };
    return {
      tableData: Array(20).fill(item),
    };
  },
  methods:{
    fn_quit(){
      console.log("退出登录");
      // localStorage.clear();
      this.$router.push({path:"/login"})

    }
  }
};
</script>
<style scope>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
.el-main{
  background:#fff;
}
.el-container{
  background:#fff;
}
</style>
